package com.doyoulike.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author 独舟
 * @description 数据库的表
 * @date 2020/3/20
 */
@Data
@ApiModel(value = "表")
public class GenTable implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    private Long id;
    @ApiModelProperty(value = "表名称", required = true)
    private String name;
    @ApiModelProperty(value = "类名", required = true)
    private String className;
    @ApiModelProperty(value = "类中文名", required = true)
    private String chName;
    @ApiModelProperty(value = "包路径", required = true)
    private String packagePath;
    @ApiModelProperty(value = "模块名", required = true)
    private String moduleName;
    @ApiModelProperty(value = "子模块名", required = false)
    private String subModuleName;
    @ApiModelProperty(value = "功能作者", required = true)
    private String functionAuthor;
    @ApiModelProperty(value = "生成方式", required = true)
    private String genTypeCode;
    @ApiModelProperty(value = "备注", required = false)
    private String remarks;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    @ApiModelProperty(value = "创建日期", required = false)
    private Date createDate;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    @ApiModelProperty(value = "更新日期", required = false)
    private Date updateDate;

    @ApiModelProperty(value = "表的列", required = false)
    private List<GenTableColumn> columnList;

    @ApiModelProperty(value = "子表数据", required = false)
    private List<GenTableChild> genTableChilds;

    @ApiModelProperty(value = "保存同时是否生成代码", required = false)
    private Boolean isCreate = false;
}